package org.example.petitionplatformsystem.service.Impl;

import org.example.petitionplatformsystem.dao.ImagesRepository;
import org.example.petitionplatformsystem.dao.model.Images;
import org.example.petitionplatformsystem.service.ImagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ImagesServiceImpl implements ImagesService {
    @Autowired
    private ImagesRepository imagesRepository;

    @Override
    public void addImage(Images images) {

        imagesRepository.save(images);
    }

    @Override
    public void deleteImage(Images images) {

        imagesRepository.delete(images);
    }

    @Override
    public void updateImage(Images images) {

        imagesRepository.save(images);
    }

    @Override
    public List<Images> getAllImages() {
        return imagesRepository.findAll();
    }
}
